package com.caac.core.web.action.user;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.caac.core.service.UserManager;
import com.caac.core.web.action.BaseAction;
import com.caac.core.web.form.BaseForm;

import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class DelUserAction extends BaseAction {

    protected ActionForward doExecute(ActionMapping mapping, BaseForm form,
                                      HttpServletRequest request,
                                      HttpServletResponse response) throws java.
            lang.Exception {
        String[] ids = request.getParameterValues("id");
        UserManager um = this.getUserManager();
        for (int i = 0; i < ids.length; i++) {
            if (ids[i].indexOf("00000000000") == -1) {
                um.deleteUserById(ids[i],
                                  this.getUserFromCache(request, response));
            	//log.info(ids[i]);
            	//this.getBaseManager().deleteObjectById(NormalUser.class, ids[i]);
            }
        }
        return forward(mapping);
    }
}
